home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / tool_inc.zip / KEYPRESS.INC < prev    next >
Text File  |  1989-06-02  |  889b  |  34 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13.    (* -------------------------------------------------------- *)
  14.    function ReadKey: Char;
  15.    var
  16.       reg: registers;
  17.    begin
  18.       reg.ax := $0700;   {direct console input}
  19.       msdos(reg);
  20.       ReadKey := chr(reg.al);
  21.    end;
  22.  
  23.  
  24.    (* -------------------------------------------------------- *)
  25.    function KeyPressed: Boolean;
  26.    var
  27.       reg: registers;
  28.    begin
  29.       reg.ax := $0b00;   {ConInputStatus}
  30.       msdos(reg);
  31.       KeyPressed := (reg.al = $FF);
  32.    end;
  33.  
  34.